package czy.demo.dubbo.provider.service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import czy.demo.dubbo.base.pojo.Person;
import czy.demo.dubbo.base.service.PersonService;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;

/* 使用dubbo的Service注解 */
@Service
@Component
public class PersonServiceImpl implements PersonService {

    private static List<Person> persons = new ArrayList<>();

    static{
        persons.add(new Person(1,"张三",12));
        persons.add(new Person(2,"李四",12));
        persons.add(new Person(3,"王五",12));
    }

    @Override
    public List<Person> findAll() {
        return persons;
    }
}
